package com.example.lock.redisLock;

import com.example.lock.DistributedLock;

import java.util.concurrent.TimeUnit;

public class SimpleJedisLock extends BaseJedisLock implements DistributedLock {


    public String acquireLock(String lockName, Long acquireTime, Long expireTime) throws Exception {
        return lockWithTimeout(lockName, acquireTime, expireTime);
    }


    public String acquireLock(String lockName, Long time, TimeUnit unit) throws Exception {
        return lockWithTimeout(lockName, time, 5000);
    }


    public void release(String lockName, String identify) throws Exception {
        releaseLock(lockName,identify);
    }

    public Boolean extendLockTime(String lockName, Long time, String identify) {
       return extendLock(lockName,identify,time);
    }
}

